package sg.edu.nus.iss.team4.entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class Questionnaire {
	private Integer id;
	private String title;
	private String qdesc;
	private boolean isActive;
	private String qurl;
	private String qtag;
	private Date createdDate;
	private Date modifiedDate;
	
	private Researcher researcher;
	private List<Question> questions = new ArrayList<Question>();
	
	public Questionnaire() {}
	
	public Questionnaire(String title, String qdesc, boolean isActive, String qurl, String qtag, Date createdDate, Date modifiedDate, Researcher researcher) {
		this.title = title;
		this.qdesc = qdesc;
		this.isActive = isActive;
		this.qurl = qurl;
		this.qtag = qtag;
		this.createdDate = createdDate;
		this.modifiedDate = modifiedDate;
		this.researcher = researcher;
	}
	
	
	public void addQuestion(Question question) {
		if (!questions.contains(question)) {
			questions.add(question);
		}
	}

	public List<Question> getQuestions() {
		return questions;
	}


	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public Date getModifiedDate() {
		return modifiedDate;
	}

	public void setModifiedDate(Date modifiedDate) {
		this.modifiedDate = modifiedDate;
	}


	public void setId(Integer id) {
		this.id = id;
	}
	public void setQuestions(List<Question> questions) {
		this.questions = questions;
	}

	public Integer getId() {
		return id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getQdesc() {
		return qdesc;
	}

	public void setQdesc(String qdesc) {
		this.qdesc = qdesc;
	}

	public boolean getIsActive() {
		return isActive;
	}

	public void setIsActive(boolean isActive) {
		this.isActive = isActive;
	}

	public String getQurl() {
		return qurl;
	}

	public void setQurl(String qurl) {
		this.qurl = qurl;
	}

	public String getQtag() {
		return qtag;
	}

	public void setQtag(String qtag) {
		this.qtag = qtag;
	}
	
	public Researcher getResearcher() {
		return researcher;
	}

	public void setResearcher(Researcher researcher) {
		this.researcher = researcher;
	}
	
}
